// @dart=2.11
import 'dart:io';

import 'package:baselib/utils/app_info_util.dart';
import 'package:baselib/utils/cupertino_localization_delegate.dart';
import 'package:baselib/utils/sp_util.dart';
import 'package:baselib/utils/res_init_util.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:framelib/utils/string_util.dart';
import 'package:framelib/utils/oss_util.dart';
import 'package:get/get.dart';
import 'package:module_business/module_comm/route/module_comm_route.dart';

void main() async{
  WidgetsFlutterBinding.ensureInitialized();

  // HttpOverrides.global = AgoraHttpOverrides();
  // //初始化下载
  // // await CommUpdateUtils.initializeFlutterDownloader();
  // //初始化AppInfo
  // await AppInfoUtil.init();
  // //初始化Sp
  // await SpUtil.getInstance();
  // //初始化资源设置
  // await ResInitUtil.getInstance();
  // //初始化云信
  // await NIMSDKUtil.instance.init();
  // //初始化
  // // await AgoraSDKUtil.instance.init();
  // //获取oss信息
  // getOssInfo();
  runApp(const MyApp());
  // Android状态栏透明 splash为白色,所以调整状态栏文字为黑色
  SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
      statusBarColor: Colors.transparent,
      statusBarBrightness: Brightness.light));
}

class MyApp extends StatelessWidget {
  const MyApp({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GetMaterialApp(
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      navigatorKey: Get.key,
      getPages: [
        ...ModuleCommRoute.getPages,
      ],
      localizationsDelegates: [
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
        // RefreshLocalizations.delegate,
        CupertinoLocalizationsDelegate(),
      ],
      supportedLocales: [
        const Locale('en', 'US'), // 美国英语
        const Locale('zh', 'CN'), // 中文简体
      ],
      debugShowCheckedModeBanner: false,
      title: StringUtil.instance.appname,
    );
  }
}


